import React from 'react'
import './index.less'

export default (
  { index = 0, 
    click, 
    heightLight, 
    heightLightStyle, 
    value  = null} : 
  { 
    index: number,
    click: (index: number) => any, 
    heightLight?: boolean,
    heightLightStyle?: object, 
    value?: string | number | null
  }) => {
    value = value ? value : null;
    return (
    <button
      className="square" 
      onClick= { () => click(index) }
      style = { heightLight ?  heightLightStyle ? heightLightStyle : { backgroundColor: 'lightblue'} : {}}
      > 
      {value}
    </button>
    )
  }
